//
//  BVCMS
//
//  Created by Allen Thomas on 1/3/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PersonDetails.h"

@protocol PersonDetailsConnectionDelegate;

@interface PersonDetailsConnection : NSObject {
	
	NSString *personId;
		
    id <PersonDetailsConnectionDelegate> delegate;
	
    NSMutableData *activeDownload;
	
    NSURLConnection *connection;
	
	PersonDetails *person;
	
}

@property (nonatomic, retain) NSString *personId;

@property (nonatomic, assign) id <PersonDetailsConnectionDelegate> delegate;

@property (nonatomic, retain) NSMutableData *activeDownload;

@property (nonatomic, retain) NSURLConnection *connection;

@property (nonatomic, retain) PersonDetails *person;


- (void)startDownload;

- (void)cancelDownload;

-(void) parseXml:(NSData *)data;
-(void) handleElement_Person: (NSDictionary*) attributes;  

@end


@protocol PersonDetailsConnectionDelegate 

- (void)personDetailsCallback:(PersonDetails *)person;
- (void)personDetailsFailed:(NSError *)error;

@end

